<template>
  <div class="not-found">
    <h3>页面不存在</h3>
    <!-- <img src="@/assets/img/404.png" /> -->
    <div>
      <a href="#/">返回首页</a>
      |
      <a class="click" @click="routerGo(-1)">返回上一页</a>
    </div>
  </div>
</template>
<script>
export default {
  methods: {
    routerGo(current, defaultUrl) {
      var state = window.history.state;
      if ((!state || !state.back) && defaultUrl != null) {
        return (location.hash = defaultUrl);
      }
      window.history.go(current);
    }
  }
};
</script>
<style>
.not-found {
  padding: 20px;
}
.not-found a {
  text-decoration: underline;
  margin-right: 5px;
}
.not-found img {
  width: 120px;
}
.not-found-content {
  padding: 20px;
  display: inline-block;
}
</style>
